package day09.KeJian;

import java.util.TreeSet;

public class MyTreeSet2 {
    public static void main(String[] args) {
        TreeSet<Student> tr = new TreeSet<>();
        Student s1 = new Student("zhangsan",24);
        Student s2 = new Student("lisi",25);
        Student s3 = new Student("wangwu",23);
        Student s4 = new Student("zhaoliu",21);
        Student s5 = new Student("qianqi",22);

        tr.add(s1);
        tr.add(s2);
        tr.add(s3);
        tr.add(s4);
        tr.add(s5);

        for (Student s: tr) {
            System.out.println(s);

        }

    }
}
